<?php
class omeanalysts_ome_aftersale extends ectools_analysis_abstract implements ectools_analysis_interface{
  
	
	public $logs_options = array(
        '1' => array(   
            'name' => '退换货量',
            'flag' => array(),
            'memo' => '符合筛选条件的所有货品退换货数量总计',
    		'icon' => 'money_delete.gif',
        ),
        '2' => array(
            'name' => '退换货率',
            'flag' => array(),
            'memo' => '符合筛选条件的所有货品退换货量/销售量',
            'icon' => 'money_delete.gif',
        ),
    );

    public $graph_options = array(
        'hidden' => true,
    );
	
    public function ext_detail(&$detail){
    	$afterObj = $this->app->model('ome_aftersale');
    	$filter = $this->_params;
    	$reshipNums = $afterObj->get_nums($filter);
    	$reshipRate = $afterObj->get_rate($filter);
    	
    	$detail['退换货量']['value'] = $reshipNums;
    	$detail['退换货量']['memo'] = '符合筛选条件的所有货品退换货数量总计';
    	$detail['退换货率']['value'] = $reshipRate;
    	$detail['退换货率']['memo'] = '符合筛选条件的所有货品退换货量/销售量';
    }
    
    public function finder(){
        return array(
            'model' => 'omeanalysts_mdl_ome_aftersale',
            'params' => array(
                'actions'=>array(
                    array(
                        'label'=>app::get('omeanalysts')->_('生成报表'),
                        'class'=>'export',
                        'icon'=>'add.gif',
                        'href'=>'index.php?app=omeanalysts&ctl=ome_analysis&act=aftersale&action=export',
                        'target'=>'{width:400,height:170,title:\'生成报表\'}'),
                ),
                'title'=>app::get('omeanalysts')->_('货品售后问题统计'),
                'use_buildin_recycle'=>false,
                'use_buildin_selectrow'=>false,
            ),
        );
    }
}